package myapps.ttclient.protocol.message;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import myapps.ttclient.Helper;
import myapps.ttclient.baseclass_and_interface.TTClientMessage;

public class NMSAuthentificationResponseMessage extends TTClientMessage {

	 public static byte TYPE_NORMAL = 0;
     public static byte TYPE_SUCCESSFUL = 1;
     public static byte TYPE_FAILED = 2;

     public byte type;

     public String text;
	
	public NMSAuthentificationResponseMessage(byte type, String text)
	{
		this.type = type;
		this.text = text;
	}
	
	public static TTClientMessage parse(DataInputStream dis) throws IOException
	{
		byte type = dis.readByte();
		
		String text = Helper.ParseAsString(dis);
		
		return new NMSAuthentificationResponseMessage(type, text);
	}
	
	
	@Override
	public void toDataOutputStream(DataOutputStream dos) throws IOException {
		throw new IOException("NotImplementedException");
	}

}
